package com.ghovos.usermangerpgdemo.common.result;

import lombok.Getter;

/**
 * 枚举类
 * 用户表示常用的 GlobalResult
 */
@Getter
public enum GlobalResultEnum {

    /*
      常用的枚举
     */
    SUCCESS(200, "成功"),
    UNAUTHORIZED(401, "暂未登陆或token失效"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_TOKEN(410, "无token"),
    JSON_WRITE_ERROR(421, "JSON序列化异常"),
    JSON_READ_ERROR(422, "JSON反序列化异常"),
    SQL_UN_ERROR(431,"唯一约束异常"),
    FAIL(201, "失败");


    private final Integer code;
    private final String message;

    GlobalResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
